package main

import "fmt"

//16ms 64%,6.1MB 99%
func singleNumbers(nums []int) []int {
	res := make([]int, 2)
	for _, v := range nums {
		res[0] ^= v
	}
	div := 1
	for div&res[0] == 0 {
		div <<= 1
	}
	res[0] = 0
	for _, v := range nums {
		if div&v == 0 {
			res[0] ^= v
		} else {
			res[1] ^= v
		}
	}
	return res
}

func main() {
	fmt.Println(singleNumbers([]int{1, 4, 22, 22, 6, 6}))
}
